#include    <bits/stdc++.h>
using namespace std;

int main() {
    int s, v;
    cin >> s >> v;
    int x = 10 + ceil(1.0 * s / v);
    int ks = (1440 + 480 - x) % 1440;

    int h = ks / 60;
    int f = ks % 60;

    cout << setfill('0') << setw(2) << h;
    cout << ":";
    cout << setfill('0') << setw(2) << f;

    return 0;
}
